//
//  AddRangeWebsiteController.m
//  yameishe3
//
//  Created by pro on 2017/3/7.
//  Copyright © 2017年 yameishe. All rights reserved.
//

#import "AddRangeWebsiteController.h"

@interface AddRangeWebsiteController ()
{
    __weak IBOutlet UIView *_typeView;
    __weak IBOutlet UIButton *_choiceTypeBtn;
}
@end

@implementation AddRangeWebsiteController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self controllerSetting];
    
  
    // Do any additional setup after loading the view.
}

-(void)viewWillDisappear:(BOOL)animated {
    // 反注册键盘
    [super viewWillDisappear:YES];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(IBAction)onTouchChoiceTypeBtn:(UIButton*)sender
{
    if (sender.selected == YES) {//关闭选择
        [UIView animateWithDuration:0.35 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
            _typeView.alpha = 0;
        } completion:nil];
    }
    else//开启选择
    {
      [UIView animateWithDuration:0.35 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
          _typeView.alpha = 1;
      } completion:nil];
    }
    sender.selected = !sender.selected;
}

-(IBAction)onTouchTypeBtn:(UIButton*)sender
{
    [UIView animateWithDuration:0.35 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
        _typeView.alpha = 0;
    } completion:nil];
    _choiceTypeBtn.selected = NO;
    [_choiceTypeBtn setTitle:sender.titleLabel.text forState:UIControlStateNormal];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
